﻿using System.Collections.Generic;
using System.Linq;

namespace Gp.Scripts.Core.Unit
{
    public partial class TableUnit : AbstractConfigTable
    {
        public IEnumerable<(int, string)> GetAllIdNamePairs()
        {
            return _dataList.Select(prop => (prop.Id, prop.Name));
        }

        public IEnumerable<int> GetAllItemID()
        {
            return _dataList.Select(prop => prop.Id);
        }
        
        public bool ContainsId(int id)
        {
            return _dataList.Any(item => item.Id == id);
        }
    }
}